<template>
  <div>
    <vxe-select v-model="val1" placeholder="请选择字段" :option-groups="opts1" clearable filterable/>
  </div>
</template>

<script lang="ts" setup>
import {inject, ref} from 'vue'


const dataFields = inject('dataFields')


const emit = defineEmits(['update:data'])

const updateParent = () => {
  emit('update:data', {
    label: val1.value,
    value: val1.value
  })
}



const val1 = ref()
const opts1 = ref([
  {
    label: '组1',
    options: [
      { label: '1-1', value: '11' },
      { label: '1-2', value: '10' }
    ]
  },
  {
    label: '组2',
    options: [
      { label: '2-1', value: '21' },
      { label: '2-2', value: '22' }
    ]
  }
])
</script>
